<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
<!--
	function submitSelect(){
		var selectValue = "";
		var radios = document.getElementsByName('id');
		for(var i = 0; i < radios.length; i++){
			if(radios[i].checked){
				selectValue = radios[i].value;
				break;
			}
		}		
		if(selectValue != ""){
			window.returnValue = selectValue;
			self.close();
		}else{
			alert("请选择客户！");
		}
	}
-->
</script>
</head>
<body style="margin: 10px 5px 0 5px;">
	<div class="tools">
		<input class="btn1" type="button" value="确 定" onclick="submitSelect()"/>&nbsp;&nbsp;
		<input class="btn1" type="button" value="取 消" onclick="window.close();"/>&nbsp;&nbsp;
	</div>

	<table id="tDept" class="table_style" style="text-align: center;">
		<tr>
			<td class="title4" width="15%">选择</td>
			<td class="title4">客户名称</td>
		</tr>
		<c:forEach var="customer" items="${customers}">
		<c:if test="${customer.isWrite == 1}">
		<tr>
			<td><input id="id" name="id" type="radio" value="${customer.id},${customer.customerName},${customer.predictCost},<fmt:formatDate value='${customer.predictContract}' pattern='yyyy-MM-dd'/>,${customer.saleStageId},${customer.requireDesc}"/></td>
			<td align="left">${customer.customerName}</td>
		</tr>
		</c:if>
		</c:forEach>
	</table>
	
	<!-- page -->
	<table class="table_page" cellpadding="0" cellspacing="0">
		<tr>
			<td class="title"></td>
			<td class="title">
				${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>&nbsp;&nbsp;&nbsp;&nbsp;
				<fmt:message key='common.page.totalPage'/>&nbsp;${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;&nbsp;&nbsp;&nbsp;
				<fmt:message key='common.page.current'/>&nbsp;${currentPage}&nbsp;<fmt:message key='common.page'/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="./saleRecord.do?action=selectCustomer&flag=1" hidefocus="true"><fmt:message key='common.page.first'/></a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="./saleRecord.do?action=selectCustomer&flag=2" hidefocus="true"><fmt:message key='common.page.previous'/></a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="./saleRecord.do?action=selectCustomer&flag=3" hidefocus="true"><fmt:message key='common.page.next'/></a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="./saleRecord.do?action=selectCustomer&flag=4" hidefocus="true"><fmt:message key='common.page.last'/></a>
			</td>
			<td class="title"></td>
		</tr>
	</table>
</body>
</html>